package com.cxria.springboottest.repository.factory

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;

import javax.persistence.EntityManager;

class BaseRepositoryFactoryBean<R extends JpaRepository<?, ?>, T, ID extends Serializable>
		extends JpaRepositoryFactoryBean<R, T, ID> {

	BaseRepositoryFactoryBean(Class<? extends R> repositoryInterface) {
		super(repositoryInterface);
	}

	@Override
	protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) {
		return new BaseRepositoryFactory<T, ID>(entityManager);
	}

}
